package com.jzm.constants;

/**
 * 业务编号与controller类的对应关系
 */
public enum BusinessCodeAndControllerEnum {
    USERCONTROLLER("001","com.jzm.controller.UserController"),
    ORDERCONTROLLER("002","com.jzm.controller.OrderController");

    private String code;
    private String className;

    BusinessCodeAndControllerEnum(String code, String className) {
        this.code = code;
        this.className = className;
    }

    public String getClassName() {
        return className;
    }

    public String getCode() {
        return code;
    }

    /**
     * 通过code获取类名称
     */
    public static  String getClassNameByCode(String code){
        BusinessCodeAndControllerEnum[] values = values();
        for (BusinessCodeAndControllerEnum e : values) {
            if(code.equals(e.getCode())){
                return e.getClassName();
            }
        }
        return "";
    }
}
